Dual OV5640 Cameras

Installation of Dual OV5640 Module

Insert the module onto the development board as follows, ensuring the arrows are aligned. Additionally, jumper P2 to the +3.3V position to ensure the module is powered by 3.3V.

image-20251124103837685

Create a New Vivado Project

The goal we want to achieve is to display the dual camera feed in real-time on both HDMI and LCD. The implementation approach is to use 2 write-only VDMA modules to transfer camera data to DDR, then use two read-only VDMA modules to retrieve data from DDR and display it on HDMI and LCD respectively through the v_axi4s_vid_out_0 IP core and v_axi4s_vid_out_1 IP core. Since this test involves both HDMI and LCD, we need to reference some engineering code from previous HDMI and LVGL tests.

Modify based on the previous HDMI project: First, enable two EMIO pins to connect to the camera's SCCB interface, and configure the pin constraints as follows:

Modify the three FCLK clocks of the Zynq IP core to 100, 125, and 200. Among them, FCLK_CLK2 serves as the clock for the extended ENET1.

image-20250811094427782

Search for vdma to add:

image-20250811091956366

Configure the four vdma modules: two for reading and two for writing, and set the parameters according to the figures below.

Two read-only VDMA:

image-20250811092106050

Two write-only VDMA configuration:

image-20250811092150372

Add two clk_wiz IP cores, one to drive the HDMI display clock and one to drive the LCD display clock. Search for clk:

image-20250811092844993

Set up the HDMI clk_wiz IP: Set it as a dynamic clock controlled by the AXI bus, with the input provided by FCLK_CLK0 at 100MHz:

image-20250811094619192

HDMI requires two clocks, which have a 5x relationship:

image-20250811094850265

Set up the LCD clk_wiz IP: Set it as a dynamic clock controlled by the AXI bus, with the input provided by FCLK_CLK0 at 100MHz:

image-20250811095805946

LCD only needs one clock output enabled:

image-20250811095908877

Refer to the previous HDMI Test document to add other required IP cores for HDMI display:

Add and search for the timing core, and configure it as shown below:

image-20250625140706307

image-20250625140834752

Search for the video out core and configure it as shown below:

image-20250625140915948

image-20250625141007912

A custom IP is required: dvi_transmitter. This IP core is located in the ip_repo folder of the project directory. We need to add it to the project's IP library. In the Block Design, connect the interface signals of the DVI Transmitter module and bring out the external ports (only the TMDS ports need to be brought out). The specific connection method is shown in the following figures:

image-20250902140426561

image-20250902140639588

 

Following the same steps as above, find our custom IP core ov5640_capture and add it to the project's IP library.

image-20250828171200725

Search for v_vid_in_axi4s. The function of this module is to convert standard video format output into AXI4-Stream data flow. Configure it:

image-20250811102256881

image-20250811102837659

Connect ov5640, v_vid_in_axi4s, and the read-operation vdma as shown below:

image-20250828171240466

Refer to the LVGL Test document to add a video out module. This module converts AXI4-Stream data flow into standard video format output, corresponding to the RGB LCD screen.

image-20250811104245419

Add a Video Timing Controller module: Search for and add the video timing controller module, double-click to open the configuration page and configure it:

image-20250811104605009

image-20250811104629999

Add a constant module to add a constant value of 1, used to connect the ce and aclken enable signals of our various modules.

image-20250811105046077

image-20250811105106316

For subsequent connections, refer to the LVGL Test document. At this point, click Run Connection Automation to automatically connect the remaining wiring. After checking all items in the pop-up settings dialog, the system will automatically connect the remaining signal lines and add the required modules. The final generated overall block diagram is as follows:

image-20250902140900555

Save the project, then click Source → Design Sources, right-click on the BLOCK project we created, and click Create HDL Wrapper to package the BLOCK file. At this point, the Block Design part is set up.

 

Configure the pins according to the schematic diagram: Configured .xdc:

Compile and synthesize the project, generate the bitstream, File→Export→Export hardware, and export the .xsa file.

Create a New Vitis Project

Similarly, create a new platform project and application project. The newly created code files are modified based on the 18-LVGL document and 19-AUDIO code: add new camera-related file code: create new folders emio_sccb_cfg, ov5640, and create a new file xadc.c. The final required src files are as follows:

image-20250811111256288

Modify the clk_wiz file code:

 

main.c:

 

Compilation and Debugging

Connect the HDMI, LCD, and ZYNQ development board.

Use TYPE-C to connect the development board's JTAG port to the computer, perform Build and debug, and observe the HDMI or LCD display.